<html>
<head><meta charset="utf-8"><title>How to compare a `hir::TraitRef` with a `ty::TraitRef` · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20compare.20a.20.60hir.3A.3ATraitRef.60.20with.20a.20.60ty.3A.3ATraitRef.60.html">How to compare a `hir::TraitRef` with a `ty::TraitRef`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246457881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20compare%20a%20%60hir%3A%3ATraitRef%60%20with%20a%20%60ty%3A%3ATraitRef%60/near/246457881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Giacomo Stevanato <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20compare.20a.20.60hir.3A.3ATraitRef.60.20with.20a.20.60ty.3A.3ATraitRef.60.html#246457881">(Jul 19 2021 at 13:58)</a>:</h4>
<p>I currently have a <code>hir::TraitRef</code>/<code>hir::PolyTraitRef</code> and I want to check if its the same as a <code>ty::TraitRef</code>. I can check if their <code>DefId</code>s are the same, however this doesn't handle generics.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>